package com.blog.dxxr.blogfront.Service.Impl;

import com.blog.dxxr.blogfront.Domain.Article;
import com.blog.dxxr.blogfront.Domain.ArticleWithBLOBs;
import com.blog.dxxr.blogfront.Mapper.ArticleMapper;
import com.blog.dxxr.blogfront.Service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ArticleServiceImpl implements ArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public List<Article> queryArticleListIndex(Map<String,Object> map) {
        return articleMapper.selectArticleListIndex(map);
    }

    @Override
    public int queryArticleTotalIndex(Map<String,Object> map) {
        return articleMapper.selectArticleTotalIndex(map);
    }

    @Override
    public List<Article> queryArticleListIndexByArticleIds(String[] tagIds) {
        return articleMapper.selectArticleListIndexByArticleIds(tagIds);
    }

    @Override
    public int queryArticleListTotalIndexByArticleIds(String[] tagIds) {
        return articleMapper.selectArticleListTotalIndexByArticleIds(tagIds);
    }

    @Override
    public List<Article> queryArticleListRecent() {
        return articleMapper.selectArticleListRecent();
    }

    @Override
    public ArticleWithBLOBs queryArticleById(String id) {
        return articleMapper.selectArticleById(id);
    }

    @Override
    public Article selectProArticleById(String id) {
        return articleMapper.selectProArticleById(id);
    }

    @Override
    public Article selectNextArticleById(String createDate) {
        return articleMapper.selectNextArticleById(createDate);
    }

    @Override
    public String queryArticleCreateDateById(String id) {
        return articleMapper.selectArticleCreateDateById(id);
    }
}
